package com.yingxue.demo.exception;

import com.yingxue.demo.exception.enums.BaseExceptionEnum;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @Package: com.company.scaffold.exception
 * @Author: Mr.Waves
 * @Date: 2020-03-08 17:52
 * @Description: 业务异常类
 **/
@Data
@AllArgsConstructor
public class BizException extends RuntimeException {
    private Integer code;
    private String message;
    private BaseExceptionEnum exceptionEnum;

    public BizException(BaseExceptionEnum baseExceptionEnum) {
        this.code = baseExceptionEnum.getCode();
        this.message = baseExceptionEnum.getMessage();
        this.exceptionEnum = baseExceptionEnum;
    }
}
